package ar.com.e2solver.conf;

import ar.com.e2solver.exception.BusinessException;

/**
 * Configuracion del Solver
 * @author rodo
 *
 */
public class E2SolverConfiguration {
	
	private Integer populationNumber;
	private Integer iterations;
	private Boolean showLog;
	
	public E2SolverConfiguration() throws BusinessException {
		try {
			// Levanta properties por default
		    this.populationNumber = Integer.parseInt(PropertiesHolder.getInstance().getProperty("configuration.default.population"));
		    this.iterations = Integer.parseInt(PropertiesHolder.getInstance().getProperty("configuration.default.iterations"));
		    this.showLog = Boolean.parseBoolean(PropertiesHolder.getInstance().getProperty("configuration.default.showLog"));
		
		} catch (NumberFormatException e) {
			throw new BusinessException("Properties mal formadas", e);
		}
	}
	
	public Integer getPopulationNumber() {
		return populationNumber;
	}
	public void setPopulationNumber(Integer populationNumber) {
		this.populationNumber = populationNumber;
	}
	public Integer getIterations() {
		return iterations;
	}
	public void setIterations(Integer iterations) {
		this.iterations = iterations;
	}
	public Boolean getShowLog() {
		return showLog;
	}
	public void setShowLog(Boolean showLog) {
		this.showLog = showLog;
	}

}
